import { AxiosError } from "axios"
import {ElMessage} from 'element-plus'



export default (error:AxiosError)=>{
    if (error.code === 'ECONNABORTED') {
        console.log('请求超时')
        ElMessage({
            message:"请求超时",
            type:"error",
            showClose:true,
        })
      } else if (error.code === 'ECONNREFUSED') {
        ElMessage({
            message:"服务器拒绝连接",
            type:"error",
            showClose:true,
        })
        console.log('服务器拒绝连接')
      } else {
        ElMessage({
            message:"发生了一个错误：",
            type:"error",
            showClose:true,
        })
        console.log('发生了一个错误：', error.message)
      }
    console.log(error)
}